$(function () {
	layui.use(['jquery','table','layer'],function () {
		let $ = layui.jquery;
		let layer = layui.layer;
		$.ajax({
			url: '/os/static',
			type: 'get',
			success: function (data) {
				$('#osName').text(data.osName);
				$('#arch').text(data.arch);
				$('#osVersion').text(data.osVersion);
				$('#userName').text(data.userName);
				$('#userHome').text(data.userHome);
				$('#lineSeparator').text(data.lineSeparator);
				$('#pathSeparator').text(data.pathSeparator);
				$('#fileSeparator').text(data.fileSeparator);
				$('#bit').text(data.bit);
				$('#processesCount').text(data.processesCount);
				$('#threadCount').text(data.threadCount);
				$('#sinceBootTime').text(data.sinceBootTime);
			},
			error: function () {
				layer.msg("出错了");
			}
		});
		function loopGetMessage(){
			$.ajax({
				url: '/os/dynamic',
				type: 'get',
				success: function (data) {
					$('#processesCount').text(data.processesCount);
					$('#threadCount').text(data.threadCount);
					$('#sinceBootTime').text(formatSeconds(data.sinceBootTime));
				},
				error: function () {
					$('#processesCount').text('error');
					$('#threadCount').text('error');
					$('#sinceBootTime').text('error');
				}
			});
		}
		loopGetMessage();
		setInterval(loopGetMessage,2000);
	});
});